<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .red{
            color: red;
        }
        .active{
            color: yellow;
        }
        .text{
            color: blue;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1 class="red" 
        v-bind:class="colorChange">hello world</h1>
    </div>
    <script src="vue.js"></script>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                isActive:true,
                isError:null
            },
            computed:{
                colorChange(){
                    return {
                        active:this.isActive && !this.isError,
                        text:this.isError&& this.isError.type == 'fatal'
                    }
                }
            }
        })
    </script>
</body>
</html>